<template>
  <mt-swipe :show-indicators="false">
    <mt-swipe-item v-for="v in swipeImage" :key="v.id" @click.native="routerTo(v.url)">
      <img :src="v.image" :alt="v.name">
    </mt-swipe-item>
  </mt-swipe>
</template>

<script>
  export default {
    name: 'swipe',
    props: ['swipeImage'],
    methods: {
      routerTo (url) {
        if (url === '' || url === undefined || url === null) {
          return false
        }
        if (url.indexOf('http') === -1) {
          this.$router.push({path: url})
        } else {
          window.location.href = url
        }
      }
    }
  }
</script>

<style>
.mint-swipe img {
  width: 100%;
  height: 100%;
}
</style>